<!DOCTYPE html>
<!--名称空间-->
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{commons/default::common-head}">
    <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <meta http-equiv="X-UA-Compatible" content="IE=8"/>
    <title>员工列表</title>
</head>
<body>
<div id="wrapper">
    <header th:replace="~{commons/header::common-header(activeUrl='employees')}"></header>
    <div id="page-wrapper">
        <div class="container-fluid">
            <!-- Page Heading -->
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header" th:text="#{employees}"></h1>
                    <ol class="breadcrumb">
                        <li><i class="fa fa-dashboard"></i> <a th:href="@{/dashboard}" th:text="#{dashboard}"></a>
                        </li>
                        <li class="active"><i class="fa fa-table"></i> <span th:text="#{employees}"></span></li>
                    </ol>
                </div>
            </div>
            <div class="row" th:if="${not #strings.isEmpty(message)}">
                <div class="col-lg-12">
                    <div class="alert alert-info alert-dismissable">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                        <i class="fa fa-info-circle"></i> <strong th:text="${message}"></strong>
                    </div>
                </div>
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <h2 th:text="#{employees}"></h2>
                    <div class="table-responsive">
                        <a class="pull-right btn" th:href="@{/employee}" th:text="#{add.employees}"></a>
                        <table class="table table-striped table-sm">
                            <thead>
                            <tr>
                                <th th:text="#{id}"></th>
                                <th th:text="#{last.name}"></th>
                                <th th:text="#{email}"></th>
                                <th th:text="#{gender}"></th>
                                <th th:text="#{department}"></th>
                                <th th:text="#{position}"></th>
                                <th th:text="#{birth}"></th>
                                <th th:text="#{operation}"></th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="emp:${employees}">
                                <td th:text="${emp.id}"></td>
                                <td>[[${emp.lastName}]]</td>
                                <td th:text="${emp.email}"></td>
                                <td th:text="${emp.gender}==0?#{female}:#{male}"></td>
                                <td th:text="${emp.department.departmentName}"></td>
                                <td th:text="${emp.department.position}"></td>
                                <td th:text="${#dates.format(emp.birth, 'yyyy-MM-dd HH:mm')}"></td>
                                <td>
                                    <a class="btn btn-sm btn-success" th:href="@{/employee/}+${emp.id}"
                                       th:text="#{edit}"></a>
                                    <a class="btn btn-sm btn-danger deleteBtn"th:href="@{/employee/}+${emp.id}"
                                       th:text="#{delete}"></a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- /.row -->
        </div>
    </div>
</div>
</body>
</html>